package com.qst.mapreduce.wordcount.diliuzhang.zuoye.mywc;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;


public class CustomPartitioner extends Partitioner<Text, IntWritable> {
    @Override
    public int getPartition(Text key, IntWritable value, int i) {
       if (key.toString().length()==4){
           return 0;
       } else if (key.toString().length()==5) {
           return 1;
       } else if (key.toString().length()==6) {
           return 2;

       } else {
           return 3;
       }

    }
}
